<?php
namespace App\Observers;

// creating, created, updating, updated, saving,
// saved,  deleting, deleted, restoring, restored

use App\Handlers\RedisHandler;
use App\Models\AdTask;

class TaskAdObserver
{
    public function saved(AdTask $model)
    {
        RedisHandler::saveModel($model,"ad:task:{$model->id}");
    }

    public function deleted(AdTask $model)
    {
        app('redis')->del(["ad:task:{$model->id}"]);
    }
}